module.exports = function ($scope, $resource, flag, id,$state,$modalInstance, $http, FileUploader, toaster) {
  var id = flag ? {'flag': true} : id;
//   console.log(eq_code)
  $scope.obj = {};
  $scope.flag = 1;
if(id !== undefined){
  $scope.flag = 0;
  $resource('/api/as/ac/evaluation/company', {}, {}).save({'company_id':id},function (res) {
    if (res.errcode !== 0) {
      alert("数据获取失败");
      return;
    }
    $scope.obj = res.data;
  })
}

console.log($scope.info);
  $scope.cancel = function () {
    $modalInstance.dismiss('cancel');
  };
  $scope.ok = function () {
      // 插入我的表里
      $resource('/api/ac/ac/evaluationService/createCompany', {}, {}).save($scope.obj,function (res) {
        if (res.errcode !== 0) {
          alert("更新失败");
          return;
        }
        $modalInstance.close();
      });
  };

  
}